#include <iostream>
#include <string>
#include <cstring>
#include <cstdlib>   // for qsort
using namespace std;

int comp(const void*, const void*);

int main()
{
   const int MAXLINES = 100;
   string strings[MAXLINES];
   int n = 0;
   while (n < MAXLINES && cin >> strings[n])
      ++n;

   // Sort & print
   qsort(strings, n, sizeof strings[0], comp);
   for (int i = 0; i < n; ++i)
      cout << strings[i] << endl;
}

int comp(const void* p1, const void* p2)
{
   const string s1 = *static_cast<const string*>(p1);
   const string s2 = *static_cast<const string*>(p2);
   return strcmp(s1.c_str(), s2.c_str());
}

